package com.zs.admin.vo.wisdbook;

import com.zs.common.util.StringUtils;
import com.zs.common.util.YmlUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

@Data
@ApiModel("智书列表Vo")
public class WisdbookListedVo  implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "")
    private Integer id;

    @ApiModelProperty(value = "书名")
    private String name;

    @ApiModelProperty(value = "年级")
    private Integer grade;

    @ApiModelProperty(value = "科目")
    private Integer subject;

    @ApiModelProperty(value = "学段")
    private Integer section;

    @ApiModelProperty(value = "教材版本")
    private Integer edition;

    @ApiModelProperty(value = "分册：0默认 1上册 2下册 3全一册")
    private Integer volume;

    @ApiModelProperty(value = "制作状态： 0未开始 1制作中  2制作完成")
    private Integer status;

    @ApiModelProperty(value = "标注状态： 0未开始 1标注中  2标注完成")
    private Integer markStatus;

    @ApiModelProperty(value = "pdf存放地址")
    private String pdfUrl;

    @ApiModelProperty(value = "封面图地址")
    private String cover;

    @ApiModelProperty(value = "pid")
    private Integer pid;

    @ApiModelProperty(value = "标注人员名字")
    String markUserName;

    public String getCover() {
        String https = YmlUtils.get("ossResource.https");
        if(StringUtils.isNotEmpty(cover)&&!StringUtils.startsWith(cover,"http")){
            return https+cover;
        }
        return cover;
    }
    public String getPdfUrl() {
        String https = YmlUtils.get("ossResource.https");
        if(StringUtils.isNotEmpty(pdfUrl)&&!StringUtils.startsWith(pdfUrl,"http")){
            return https+pdfUrl;
        }
        return pdfUrl;
    }

}
